<?php 
		$user = $_POST;
		if (!empty($user['username']&&$user['password']&&$user['nikename']&&$user['sex'])) {
			$pwd = md5($user['password']);
			$user['password'] = $pwd;
			$save = include './save.php';
			array_push($save, $user);
			//转成合法的数据结构
			$str = var_export($save, true);
			$str = "<?php return ".$str."?>";
			file_put_contents('./save.php', $str);
			header('location:./index.php');
		}else{
			header("Refresh:2,Url='./Tpl/register.html'");
			header("Content-type:text/html;charset=utf-8");
     		echo '2s 后跳转,数据不能为空';
		}
	
	












 ?>